using System;
using System.Xml;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace Caramel.ServiceModel
{
	public class NetDataContractSerializerOperationBehavior : DataContractSerializerOperationBehavior
	{
		public NetDataContractSerializerOperationBehavior(OperationDescription operation)
			: base(operation)
		{
		}

		public NetDataContractSerializerOperationBehavior(OperationDescription operation, DataContractFormatAttribute dataContractFormatAttribute)
			: base(operation, dataContractFormatAttribute)
		{
		}

		public override XmlObjectSerializer CreateSerializer(Type type, string name, string ns, IList<Type> knownTypes)
		{
			return new NetDataContractSerializer(name, ns);
		}

		public override XmlObjectSerializer CreateSerializer(Type type, XmlDictionaryString name, XmlDictionaryString ns, IList<Type> knownTypes)
		{
			return new NetDataContractSerializer(name, ns);
		}
	}
}
